//
//  NSObject+time.m
//  UserUse
//
//  Created by 李佳楠 on 2016/10/27.
//  Copyright © 2016年 CJPC. All rights reserved.
//

#import "NSObject+time.h"

@implementation NSObject (time)
-(NSString *)getCurrentTime
{
    NSDate *date = [NSDate date];
    NSDateFormatter *dateformatter = [[NSDateFormatter alloc]init];
    [dateformatter setDateFormat:@"yyyy-MM-dd-HH-mm-ss"];
    NSString *currentTime = [NSString stringWithFormat:@"%@",[dateformatter stringFromDate:date]];
    return currentTime;
}
-(NSString *)getTenMinutesLater
{
    NSDate *date = [NSDate dateWithTimeIntervalSinceNow:60 * 10];
    NSDateFormatter *dateformatter = [[NSDateFormatter alloc]init];
    [dateformatter setDateFormat:@"yyyy-MM-dd-HH-mm-ss"];
    NSString *currentTime = [NSString stringWithFormat:@"%@",[dateformatter stringFromDate:date]];
    return currentTime;
}

-(NSString *)getToday
{
    NSDate *date = [NSDate date];
    NSDateFormatter *dateformatter = [[NSDateFormatter alloc]init];
    [dateformatter setDateFormat:@"yyyy年MM月dd日"];
    NSString *currentTime = [NSString stringWithFormat:@"%@",[dateformatter stringFromDate:date]];
    return currentTime;
}
-(NSString *)getTomorrow
{
    NSDate *date = [NSDate dateWithTimeIntervalSinceNow:60 * 60 *24];
    NSDateFormatter *dateformatter = [[NSDateFormatter alloc]init];
    [dateformatter setDateFormat:@"yyyy年MM月dd日"];
    NSString *currentTime = [NSString stringWithFormat:@"%@",[dateformatter stringFromDate:date]];
    return currentTime;
}
-(NSString *)getAfterDay
{
    NSDate *date = [NSDate dateWithTimeIntervalSinceNow:60 * 60 * 24 * 2];
    NSDateFormatter *dateformatter = [[NSDateFormatter alloc]init];
    [dateformatter setDateFormat:@"yyyy年MM月dd日"];
    NSString *currentTime = [NSString stringWithFormat:@"%@",[dateformatter stringFromDate:date]];
    return currentTime;
}
-(NSString *)getHToday
{
    NSDate *date = [NSDate date];
    NSDateFormatter *dateformatter = [[NSDateFormatter alloc]init];
    [dateformatter setDateFormat:@"yyyy-MM-dd"];
    NSString *currentTime = [NSString stringWithFormat:@"%@",[dateformatter stringFromDate:date]];
    return currentTime;
}
-(NSString *)getHTomorrow
{
    NSDate *date = [NSDate dateWithTimeIntervalSinceNow:60 * 60 *24];
    NSDateFormatter *dateformatter = [[NSDateFormatter alloc]init];
    [dateformatter setDateFormat:@"yyyy-MM-dd"];
    NSString *currentTime = [NSString stringWithFormat:@"%@",[dateformatter stringFromDate:date]];
    return currentTime;
}
-(NSString *)getHAfterDay
{
    NSDate *date = [NSDate dateWithTimeIntervalSinceNow:60 * 60 * 24 * 2];
    NSDateFormatter *dateformatter = [[NSDateFormatter alloc]init];
    [dateformatter setDateFormat:@"yyyy-MM-dd"];
    NSString *currentTime = [NSString stringWithFormat:@"%@",[dateformatter stringFromDate:date]];
    return currentTime;
}

@end
